<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2019-10-04
 * Time: 08:23
 */

namespace App\Http\Controllers\Admin\View;


use App\Http\Controllers\Controller;
use App\Http\Repositories\Services\IOrder;

class OrderController extends Controller
{
    protected $orderService;

    public function __construct(IOrder $orderService)
    {
        $this->orderService = $orderService;
    }

    public function index(){
        return view('admin.order.index');
    }

    public function create(){
        return view('admin.order.create');
    }

    public function pdf($id){

        $data = $this->orderService->byId($id);
        $html = view('admin.order.order_pdf',compact('data'));
        return $html;
        //$pdf = \PDF::loadHTML($html);
        //return $pdf->inline();
    }



}